import requests
import unittest
from unit__001.unit_02.Mysql import Mysql


class A3mall(unittest.TestCase):
    def setUp(self) -> None:
        print('start case')
        # 初始化数据库
        self.db = Mysql(host='10.59.9.12', user='root', password='yidong666', database='a3mall')

    def tearDown(self) -> None:
        print('end case')
        # 调用关闭数据库的方法
        self.db.close()

    token = None

    # 登录
    def test_A3mall_01(self):
        login = requests.post(url='http://10.59.9.14:7003/api/public/login',
                              json={"username": "18185603001", "password": "123456"})
        print(login.json())


if __name__ == '__main__':
    unittest.main()
